/*
 * Copyright (c) 2016. For Intelligent Group.
 */

package com.intelligent.ispc.core.service;


import com.intelligent.ispc.core.dto.*;
import com.intelligent.ispc.r.dto.NDStandardDto;

import java.util.List;
import java.util.Map;

/**
 * Created by Julia.Zhou on 2016/08/16.
 */
public interface SpcService {

    /**
     * To analyze file and get all the searchable items' name
     *
     * @param filePaths paths of file to analyze
     * @return all data contains in a dto
     */
    FieldDataSourceDto findFieldDataSource(List<String> filePaths);

    /**
     * To get item analysis data by itemNames
     *
     * @param filePath      paths of file to analyze
     * @param searchKeys    describe search conditions
     * @param testItemNames item names for statistic
     * @param excludeItems  specific data of test item to exclude
     * @param param         standard param,contains usl ,lsl and unit
     * @param chartNames    names of charts
     * @return all data contains in a dto
     */
    List<SpcResultDto> getStatisticResult(List<KeyValueDto> filePath, List<DynSearchFieldDto> searchKeys, List<String> testItemNames, List<TestItemDto> excludeItems, NDStandardDto param, List<String> chartNames);

    /**
     * To get item analysis data by itemNames
     *
     * @param filePath      paths of file to analyze
     * @param searchKeys    describe search conditions
     * @param testItemNames item names for statistic
     * @param excludeItems  specific data of test item to exclude
     * @param param         standard param,contains usl ,lsl and unit
     * @param chartNames    names of charts
     * @return all data contains in a dto
     */
    List<SpcResultDto> getStatisticResult(List<KeyValueDto> filePath, Map<String, List<DynSearchFieldDto>> searchKeys, List<String> testItemNames,
                                          Map<String, List<TestItemDto>> excludeItems, Map<String, NDStandardDto> param, Map<String, List<String>> chartNames);

    /**
     * To get item analysis data by itemNames
     *
     * @param filePath      paths of file to analyze
     * @param exportDtos    necessary export params of each testItem
     * @param testItemNames item names for statistic
     * @return all data contains in a dto
     */
    List<SpcResultDto> getStatisticResult(List<KeyValueDto> filePath, Map<String, SpcExportDto> exportDtos, List<String> testItemNames);

    /**
     * To export the specific item data
     *
     * @param files        paths of file to analyze
     * @param searchKeys   describe search conditions
     * @param testItemName name of test item to export
     * @param chartNames   kinds of chart to include in exporting
     * @param guidesParams value of guides lines
     * @param excludeItems specific data of test item to exclude
     * @param param        standard param,contains usl ,lsl and unit
     * @return the path of exported excel
     */
    String exportAllChart(List<KeyValueDto> files, List<DynSearchFieldDto> searchKeys, String testItemName, List<String> chartNames,
                          Map<String, ChartDto> guidesParams, List<TestItemDto> excludeItems, NDStandardDto param);

    /**
     * To export items ndc data
     *
     * @param files        paths of file to analyze
     * @param searchKeys   describe search conditions
     * @param testItemName name of test item to export
     * @return the path of exported excel
     */
    String exportMultipleNDChart(List<KeyValueDto> files, List<DynSearchFieldDto> searchKeys, List<String> testItemName);

    /**
     * To export the specific item data
     *
     * @param files        paths of file to analyze
     * @param searchKeys   describe search conditions
     * @param testItemName name of test item to export
     * @param chartNames   kinds of chart to include in exporting
     * @param guidesParams value of guides lines
     * @param excludeItems specific data of test item to exclude
     * @param param        standard param,contains usl ,lsl and unit
     * @return the path of exported excel
     */
    String exportMultipleItem(List<KeyValueDto> files, Map<String, List<DynSearchFieldDto>> searchKeys, List<String> testItemName,
                              Map<String, List<String>> chartNames, Map<String, Map<String, ChartDto>> guidesParams, Map<String, List<TestItemDto>> excludeItems, Map<String, NDStandardDto> param);

    /**
     * To export the specific item data
     *
     * @param files      paths of file to analyze
     * @param exportDtos necessary export params of each testItem
     * @return the path of exported excel
     */
    String exportMultipleItem(List<KeyValueDto> files, Map<String, SpcExportDto> exportDtos);
}
